package com.icode.core.model.house;

import com.icode.core.dto.house.ForEnumDTO;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: SunKai
 * Date: 14-11-26
 * Time: 下午2:22
 * To change this template use File | Settings | File Templates.
 */
public enum DirectionType {
    NORTH_TO_SOUTH("坐北朝南"),
    EAST_TO_WEST("坐东向西"),
    OTHER_DIRECTION("其他朝向");
    private String label;

    private DirectionType(String label) {
        this.label = label;
    }

    public String getLabel() {
        return label;
    }

    public String getValue() {
        return name();
    }

    public static List<ForEnumDTO> toDTO() {
        List<ForEnumDTO> forEnumDTOs = new ArrayList<>();
        for (DirectionType directionType : DirectionType.values()) {
            String value = directionType.name();
            String label = directionType.getLabel();
            ForEnumDTO forEnumDTO = new ForEnumDTO(value, label);
            forEnumDTOs.add(forEnumDTO);
        }
        return forEnumDTOs;
    }
}
